Bentley Map V8i (SELECTseries 10) Help

Other SQL Statements

Beside the SELECT statement mentioned in the previous section, it is also possible to use any other SQL statements that updates the database or the data dictionary, but do not return a value.

For example:

  • INSERT

  • UPDATE

  • DELETE

  • DROP TABLE

  • CREATE TABLE

  • ALTER TABLE

  • etc.

Use the DEFINE SQL command to define a SQL statement that does not return a value. This works similar to the DEFINE SELECT command described in the previous section.

Syntax:

DEFINE SQL logical_name
SQL statement
END

Example:

DEFINE SQL pipe_200
update pipe set dimension=200 where id=$(MyID)
END
... 
UPDATE pipe_200

Alternatively, it is possible to write the UPDATE (or any other SQL statements) statement directly in the script.

UPDATE pipe set dimension=200 where id=$(MyID)

Note: Special syntax is used for $(variablename).

Before the command is sent to the database, the $(variable) is expanded so that if MyID equals ‘abc’ the command going to the database looks like this:

UPDATE pipe set dimension=200 where id=’abc’

This syntax can be used in any database command sent to the database for scripting.